package com.recruit.wechat.controller;


import com.recruit.wechat.controller.model.ApiResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import com.recruit.wechat.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recruit.wechat.bean.WechatLabelType;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LF
 * @since 2020-08-25
 */
@Controller
@RequestMapping("/WeChatUser/wechatLabelType")
public class WechatLabelTypeController extends BaseController{
     /** 主页面 */
    @RequestMapping("admin/main.html")
    public String main(){
       return  "wechatLabelType/WechatlabeltypeMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "admin/addWechatLabelTypeHtml")
    public String addWechatLabelTypeHtml( ){
             return "wechatLabelType/WechatlabeltypeAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/editWechatLabelTypeHtml")
    public String editWechatLabelTypeHtml(Integer id ,Model model ){
           model.addAttribute("wechatLabelType",wechatLabelTypeService.selectWechatLabelTypeByIdWechatLabelType(id));
             return "wechatLabelType/WechatlabeltypeEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/showWechatLabelTypeHtml")
    public String showWechatLabelTypeHtml(Integer id ,Model model ){
           model.addAttribute("wechatLabelType",wechatLabelTypeService.selectWechatLabelTypeByIdWechatLabelType(id));
             return "wechatLabelType/WechatlabeltypeShow";
    }


    /** 分页查询WechatLabelType
     * @param page  页码
     * @param limit  查几条
     * @param wechatLabelType  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "admin/findWechatLabelTypeByPage")
    @ResponseBody
    public ResultPage findWechatLabelTypeByPage(Integer page, Integer limit,WechatLabelType wechatLabelType){
             return wechatLabelTypeService.findWechatLabelTypeByPage(page,limit,wechatLabelType);
    }

    /** 添加WechatLabelType
     * @param wechatLabelType  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/addWechatLabelType")
    @ResponseBody
    public ApiResultModel saveWechatLabelType(WechatLabelType wechatLabelType  ){
             return wechatLabelTypeService.addWechatLabelType(wechatLabelType);
    }

    /** 编辑WechatLabelType
     * @param wechatLabelType  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/editWechatLabelType")
    @ResponseBody
    public ApiResultModel editWechatLabelType(WechatLabelType wechatLabelType  ){
             return wechatLabelTypeService.editWechatLabelType(wechatLabelType);
    }



    /** 删除一条WechatLabelType
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/delWechatLabelType")
    @ResponseBody
    public ApiResultModel delWechatLabelType( Integer id  ){
             return wechatLabelTypeService.delWechatLabelType(id);
    }


}
